#include <stdio.h>
#include <string.h>


#include "parser.h"
#include "csmodelgenerator.h"
#include "cspmodelgenerator.h"
#include "csfmodelgenerator.h"
#include "sqlspguardar.h"

int main(int nargs, char *argv[])
{
	int error=init_model_ls();
	if(nargs<2)
		error=INVALID_FILE;
	else
	{
		init(argv[1]);
		while(get_token()[0]!='\0' && error==OK)
		{
			error=begin_parse();
			
		}
		model_list_preview ();
		cs_models_generator(model_list);
		cs_pmodels_generator(model_list);
		cs_fmodels_generator(model_list);
		cs_models_sqlspguardar_generator(model_list);
	}
	printf("%d\n",error);
	return error;
}
